﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FB.Data.Housekeep.Models
{
    [Table("OptionsCommissionSummaries")]
    public class OptionsCommission
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }

        [Required, StringLength(256)]
        public string ProductCode { get; set; }

        [Required, StringLength(256)]
        public string Product { get; set; }

        [Required, StringLength(256)]
        public string ProductDate { get; set; }

        [Required]
        public DateTime TradeDate { get; set; }

        [StringLength(256)]
        public string AECode { get; set; }

        [StringLength(256)]
        public string AEName { get; set; }

        [Required, StringLength(2)]
        public string AccType { get; set; }

        [Required, StringLength(256)]
        public string ClientCode { get; set; }

        [Required, StringLength(256)]
        public string ClientName { get; set; }

        [Required, StringLength(2)]
        public string BuySell { get; set; }

        public int LotsTX { get; set; }

        public int? LotsDAY { get; set; }

        public int? LotsOVN { get; set; }

        [Required, StringLength(3)]
        public string Curr { get; set; }

        public decimal Price { get; set; }

        [StringLength(2)]
        public string CallPut { get; set; }

        public decimal Premium { get; set; }

        [Required, StringLength(8)]
        public string ContractNo { get; set; }

        [Required, StringLength(3)]
        public string CommCurr { get; set; }

        public decimal Commission { get; set; }

        [Required, StringLength(3)]
        public string RebateCurr { get; set; }

        public decimal CommissionInRebCurr { get; set; }

        public decimal RebateAmount { get; set; }

        [MaxLength(8)]
        public string ChannelCode { get; set; }

        [Required]
        [MaxLength(256)]
        public string CreateBy { get; set; }

        public DateTime CreateDate { get; set; }

        //public virtual ICollection<OptionsCommissionDetail> TradeDetails { get; set; }

        public OptionsCommission()
        {
            //TradeDetails = new List<OptionsCommissionDetail>();
        }
    }

    //public class OptionsCommissionDetail
    //{
    //    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    //    public long ID { get; set; }

    //    public long TradeID { get; set; }

    //    [Required]
    //    public decimal Premium { get; set; }

    //    public int LotsTX { get; set; }

    //    public int? LotsDAY { get; set; }

    //    public int? LotsOVN { get; set; }

    //    [ForeignKey("TradeID")]
    //    public virtual OptionsCommission Trade { get; set; }
    //}
}
